home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / lib / perl5 / Glib / Flags.pod < prev    next >
Encoding:
Text File  |  2012-02-20  |  2.7 KB  |  180 lines

  1. =head1 NAME
  2.  
  3. Glib::Flags -  Overloaded operators representing GLib flags
  4.  
  5. =cut
  6.  
  7. =head1 HIERARCHY
  8.  
  9.   Glib::Flags
  10.  
  11.  
  12.  
  13. =cut
  14.  
  15. =for object Glib::Flags Overloaded operators representing GLib flags
  16.  
  17. =for position DESCRIPTION
  18.  
  19. =head1 DESCRIPTION
  20.  
  21. Glib maps flag and enum values to the nicknames strings provided by the
  22. underlying C libraries.  Representing flags this way in Perl is an interesting
  23. problem, which Glib solves by using some cool overloaded operators. 
  24.  
  25. The functions described here actually do the work of those overloaded
  26. operators.  See the description of the flags operators in the "This Is
  27. Now That" section of L<Glib> for more info.
  28.  
  29. =cut
  30.  
  31.  
  32.  
  33.  
  34. =head1 METHODS
  35.  
  36. =head2 scalar = $class-E<gt>B<new> ($a)
  37.  
  38. =over
  39.  
  40. =item * $a (scalar) 
  41.  
  42. =back
  43.  
  44. Create a new flags object with given bits.  This is for use from a
  45. subclass, it's not possible to create a C<Glib::Flags> object as such.
  46. For example,
  47.  
  48.     my $f1 = Glib::ParamFlags->new ('readable');
  49.     my $f2 = Glib::ParamFlags->new (['readable','writable']);
  50.  
  51. An object like this can then be used with the overloaded operators.
  52.  
  53. =head2 scalar = $a-E<gt>B<all> ($b, $swap)
  54.  
  55. =over
  56.  
  57. =item * $b (scalar) 
  58.  
  59. =item * $swap (scalar) 
  60.  
  61. =back
  62.  
  63. =head2 aref = $f->B<as_arrayref>
  64.  
  65. =over
  66.  
  67. =back
  68.  
  69. Return the bits of $f as a reference to an array of strings, like
  70. ['flagbit1','flagbit2'].  This is the overload function for C<@{}>,
  71. ie. arrayizing $f.  You can call it directly as a method too.
  72.  
  73. Note that @$f gives the bits as a list, but as_arrayref gives an arrayref.
  74. If an arrayref is what you want then the method style
  75. somefunc()->as_arrayref can be more readable than [@{somefunc()}].
  76.  
  77. =head2 bool = $f->B<bool>
  78.  
  79. =over
  80.  
  81. =back
  82.  
  83. Return 1 if any bits are set in $f, or 0 if none are set.  This is the
  84. overload for $f in boolean context (like C<if>, etc).  You can call it
  85. as a method to get a true/false directly too.
  86.  
  87. =head2 integer = $a-E<gt>B<eq> ($b, $swap)
  88.  
  89. =over
  90.  
  91. =item * $b (scalar) 
  92.  
  93. =item * $swap (integer) 
  94.  
  95. =back
  96.  
  97. =head2 integer = $a-E<gt>B<ge> ($b, $swap)
  98.  
  99. =over
  100.  
  101. =item * $b (scalar) 
  102.  
  103. =item * $swap (integer) 
  104.  
  105. =back
  106.  
  107. =head2 scalar = $a-E<gt>B<intersect> ($b, $swap)
  108.  
  109. =over
  110.  
  111. =item * $b (scalar) 
  112.  
  113. =item * $swap (scalar) 
  114.  
  115. =back
  116.  
  117. =head2 integer = $a-E<gt>B<ne> ($b, $swap)
  118.  
  119. =over
  120.  
  121. =item * $b (scalar) 
  122.  
  123. =item * $swap (integer) 
  124.  
  125. =back
  126.  
  127. =head2 scalar = $a-E<gt>B<sub> ($b, $swap)
  128.  
  129. =over
  130.  
  131. =item * $b (scalar) 
  132.  
  133. =item * $swap (scalar) 
  134.  
  135. =back
  136.  
  137. =head2 scalar = $a-E<gt>B<union> ($b, $swap)
  138.  
  139. =over
  140.  
  141. =item * $b (scalar) 
  142.  
  143. =item * $swap (scalar) 
  144.  
  145. =back
  146.  
  147. =head2 scalar = $a-E<gt>B<xor> ($b, $swap)
  148.  
  149. =over
  150.  
  151. =item * $b (scalar) 
  152.  
  153. =item * $swap (scalar) 
  154.  
  155. =back
  156.  
  157.  
  158.  
  159. =cut
  160.  
  161.  
  162. =head1 SEE ALSO
  163.  
  164. L<Glib>
  165.  
  166.  
  167. =cut
  168.  
  169.  
  170. =head1 COPYRIGHT
  171.  
  172. Copyright (C) 2003-2011 by the gtk2-perl team.
  173.  
  174. This software is licensed under the LGPL.  See L<Glib> for a full notice.
  175.  
  176.  
  177.  
  178. =cut
  179.  
  180.